package club.banyuan.phoy.game;

/**
 * @author sanye
 * @version 1.0
 * @date 2020/11/23 4:00 下午
 */
public class TestGane {


  public static void main(String[] args) {
    SpearWeapon spearWeapon = new SpearWeapon();
     HalberdWeapon halberdWeapon = new HalberdWeapon();
      Broadsword broadsword = new Broadsword();
      Sword sword = new Sword();


      Fighter fighter1 = new Fighter("张飞", spearWeapon);
    Fighter fighter3 = new Fighter("关羽", broadsword);
    Fighter fighter4 = new Fighter("刘备", sword);
    Fighter fighter2 = new Fighter("吕布", halberdWeapon);

   while (fighter1.getHp()>0 && fighter2.getHp()>0){
     fighter2.attack(fighter1);
     fighter2.attack(fighter3);
     fighter2.attack(fighter4);
     fighter1.attack(fighter2);
     fighter3.attack(fighter2);
     fighter4.attack(fighter2);
   if(fighter2.getHp()<0){
       System.out.println("吕布已战死。。。");
       break;
   }
   }





  }

}
